﻿<Window x:Class="CloudClipboardSync.Windows.LoginWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:w="clr-namespace:CloudClipboardSync.MvvmFw"
        Title="Login :: Cloud Clipboard Sync" SizeToContent="WidthAndHeight" DataContext="{Binding LoginWindowModel, Source={StaticResource programData}}">
    <StackPanel Margin="30 50">
        <Image Source="/Images/icon.png" Width="48" Height="48" />
        <TextBlock Text="Cloud Clipboard Sync" FontSize="36" Margin="0 15 0 0"/>
        <StackPanel Margin="0 50 0 0" HorizontalAlignment="Center">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Username: " FontSize="16" VerticalAlignment="Center" FontWeight="SemiBold" Width="90"/>
                <ComboBox Width="200" FontSize="16" ItemsSource="{Binding Users}" Padding="6 4" Text="{Binding Username}" IsEditable="True"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 10 0 0">
                <TextBlock Text="Password: " FontSize="16" VerticalAlignment="Center" FontWeight="SemiBold" Width="90"/>
                <PasswordBox Width="200" FontSize="16" Padding="4 2" KeyDown="PasswordBoxKeyUp"
                             w:PasswordHelper.Attach="True" w:PasswordHelper.Password="{Binding Password}"/>
            </StackPanel>
            <TextBlock Text="Bad username or password!" FontSize="12" HorizontalAlignment="Center" Margin="0 10 0 0" Foreground="Red"
                       Visibility="{Binding LoginError, Converter={StaticResource HideIfFalse}}"/>
            <TextBlock Text="Please fill at least the username field!" FontSize="12" HorizontalAlignment="Center" Margin="0 10 0 0" Foreground="Red"
                       Visibility="{Binding UsernameIsEmpty, Converter={StaticResource HideIfFalse}}"/>
            <Button Content="Login" FontSize="16" Padding="4 2" Margin="0 35 0 0" Width="100" Command="{Binding LoginCommand}" IsDefault="True"/>
            <TextBlock HorizontalAlignment="Center" Margin="10">
                <Hyperlink Command="{Binding RegisterCommand}">
                    <Run Text="or login with a new account" />
                </Hyperlink>
            </TextBlock>
        </StackPanel>
    </StackPanel>
</Window>
